<template>
    <view>
        <!--提示框组件-->
        <u-toast ref="uToast" />
        <view v-for="(item, index) in advert" :key="index">
            <u--image :showLoading="true" :src="item.imageUrl" mode="widthFix" width="100%" height="auto" @click="showSliderInfo(item.type, item.val)"></u--image>
        </view>
    </view>
</template>

<script>
    export default {
        props: {
            codes: {
                type: String,
                required: true,
                default: 'tpl1_class_banner1'
            }
        },
        data() {
            return {
                advert: [],
            }
        },
        created() {
            //console.log(this.codes);
            this.getData();
        },
        methods: {
            getData() {
                this.$u.api.advert({
                    codes: this.codes
                }).then(res => {
                    this.advert = res.data;
                });
            },
        },
    }
</script>
<style scoped lang="scss">
</style>
